#ifndef RESOURCE_H
#define RESOURCE_H

#include "Object.h"
#include <tr1/memory>
#include <iostream>

namespace SolidityEngine {

///Base class defining a commin interface to a Resource
class Resource: public Object
{

    protected:
        std::string path;
        int count;

    public:
        ///the name will be derived from the path
        Resource(const std::string& path, const std::string& name="Resource");
        ~Resource();

        ///Loads the resource, and returns a pointer to it
        virtual void Load();

        //Unloads the resource
        virtual void Unload();


    private:
        ///Clone the resource
        virtual Resource* _Clone();
        std::string _Serialize(){
            return std::string("Serialization not implemented for: ")+std::string(typeid(*this).name());
        };
};

typedef std::tr1::shared_ptr<Resource> Resource_ptr;


};

#endif // RESOURCE_H
